<?php 
/* SVN FILE: $Id: troop.test.php 17 2009-04-20 02:00:59Z ake.svedin $ */
/**
 * Travian Alliance Coordinator
 * Copyright (c) 2009 Åke Svedin.
 *
 * This file is part of Travian Alliance Coordinator.
 *
 * Travian Alliance Coordinator is free software: you can redistribute it and/or
 * modify it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * Travian Alliance Coordinator is distributed in the hope that it will be
 * useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General
 * Public License for more details.
 *
 * You should have received a copy of the GNU General Public License along with
 * Travian Alliance Coordinator.  If not, see <http://www.gnu.org/licenses/>.
 *
 * @author $Author: ake.svedin $
 * @copyright Copyright (c) 2009 Åke Svedin.
 * @version $Revision: 17 $
 * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3
 */
App::import('Model', 'Troop');

class TroopTestCase extends CakeTestCase {
	var $Troop = null;
	var $fixtures = array('app.troop', 'app.village');

	function startTest() {
		$this->Troop =& ClassRegistry::init('Troop');
	}

	function testTroopInstance() {
		$this->assertTrue(is_a($this->Troop, 'Troop'));
	}

	function testTroopFind() {
		$this->Troop->recursive = -1;
		$results = $this->Troop->find('first');
		$this->assertTrue(!empty($results));

		$expected = array('Troop' => array(
			'id'  => 1,
			'village_id'  => 1,
			'tid'  => 1,
			't1'  => 1,
			't2'  => 1,
			't3'  => 1,
			't4'  => 1,
			't5'  => 1,
			't6'  => 1,
			't7'  => 1,
			't8'  => 1,
			't9'  => 1,
			't10'  => 1,
			'modified'  => '2009-04-12 20:05:25'
		));
		$this->assertEqual($results, $expected);
	}
}
?>